package zzxkj.blog.config;

import com.github.javafaker.Faker;
import org.modelmapper.ModelMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.Locale;

/**
 * 初始化一些工具
 * @author zzxkj
 */
@Configuration
public class MvcConfig implements WebMvcConfigurer {
    /**
     * bean映射工具
     * @return
     */
    @Bean
    public ModelMapper ModelMapper(){
        return new ModelMapper();
    }
    /**
     * faker造数据，这里用于聊天名称
     * 构造函数指定为中文
     */
    @Bean
    public Faker Faker(){
        return new Faker(Locale.CHINA);
    }

}
